﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UcHMenu.ascx.cs" Inherits="TheHeGeoCommercial.Master.UcHMenu" %>
<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.v14.1, Version=14.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<div class="com-sub-head">
    
    <dx:ASPxGridView ID="ASPxGridView1"  runat="server" AutoGenerateColumns="False" KeyFieldName="MaLoaiSanPham" Width="100%" Cursor="pointer" ClientInstanceName="ASPxGridView1" EnableTheming="True" Theme="Default">
        <ClientSideEvents FocusedRowChanged="
" RowClick="function(s, e) {
}" SelectionChanged="function(s, e) {
	 if (e.isSelected) {
        var key = s.GetRowKey(e.visibleIndex);
		OnGetRowValues (key);  
    }
}" />
        <Columns>
            <dx:GridViewDataTextColumn FieldName="TenLoaiSanPham" VisibleIndex="0">
                <CellStyle Font-Size="12pt" Cursor="pointer" >
                    <BorderBottom BorderColor="#E8E8E8" BorderStyle="Solid" BorderWidth="2px" />
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="MaLoaiSanPham" Visible="False" VisibleIndex="1">
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsBehavior AllowDragDrop="False" AllowGroup="False" AllowSort="False" AllowSelectByRowClick="True" />
        <SettingsPager Mode="ShowAllRecords">
        </SettingsPager>
        <Settings ShowColumnHeaders="False" ShowGroupButtons="False" />
        <SettingsDataSecurity AllowDelete="False" AllowEdit="False" AllowInsert="False" />
        <Styles>
            <SelectedRow BackColor="#F2F2F2" Font-Bold="True" ForeColor="Black" >
            </SelectedRow>
            <FocusedRow Font-Bold="True" ForeColor="Black">
            </FocusedRow>
        </Styles>
        <Border BorderStyle="None" />
        <BorderBottom BorderStyle="None" />
    </dx:ASPxGridView>
    <script>
        function OnGetRowValues(values) {
            location.href = '../Commercial/Products.aspx?type=' + values;
        }

        function OnGridFocusedRowChanged() {
            ASPxGridView1.GetRowValues(ASPxGridView1.GetFocusedRowIndex(), 'MaLoaiSanPham', OnGetRowValues);
        }

    </script>
</div>